﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Eagles.Application.Model;
using Eagles.Application.Model.Audit.Model;
using Eagles.Application.Model.Audit.Requset;
using Eagles.Application.Model.Audit.Response;
using Eagles.Application.Model.Goods.Requset;
using Eagles.Application.Model.News.Requset;
using Eagles.Application.Model.PartyMember.Requset;
using Eagles.Application.Model.Publicity.Request;
using Eagles.Base;
using Eagles.Base.Cache;
using Eagles.DomainService.Model.Audit;
using Eagles.DomainService.Model.Oper;
using Eagles.DomainService.Model.Score;
using Eagles.DomainService.Model.User;
using Eagles.Interface.Configuration;
using Eagles.Interface.Core;
using Eagles.Interface.DataAccess;
using Type = Eagles.Application.Model.Audit.Model.Type;

namespace Eagles.DomainService.Core
{
    public class AuditHandler : IAuditHandler
    {

        private readonly IGoodsDataAccess goodAccess;

        private readonly INewsDataAccess NewAccess;
        private readonly IAuditDataAccess dataAccess;
        private readonly IEaglesConfig configuration;
        private readonly ICacheHelper cacheHelper;
        private readonly IPartyMemberDataAccess UserdataAccess;
        private readonly IPublicityDataAccess PubdataAccess;
        private readonly IOperGroupHandler OperGroupdataAccess;
        private readonly IOperDataAccess OperdataAccess;

        public AuditHandler(IAuditDataAccess dataAccess, ICacheHelper cacheHelper,
            IOperGroupHandler operGroupdataAccess, IPublicityDataAccess pubdataAccess,
            IPartyMemberDataAccess userdataAccess, IEaglesConfig configuration, IOperDataAccess operdataAccess, INewsDataAccess newAccess, IGoodsDataAccess goodAccess)
        {
            this.dataAccess = dataAccess;
            this.cacheHelper = cacheHelper;
            OperGroupdataAccess = operGroupdataAccess;
            PubdataAccess = pubdataAccess;
            UserdataAccess = userdataAccess;
            this.configuration = configuration;
            OperdataAccess = operdataAccess;
            NewAccess = newAccess;
            this.goodAccess = goodAccess;
        }

        public bool CreateAudit(CreateAuditRequset requset)
        {






            var token = cacheHelper.GetData<TbUserToken>(requset.Token);
            var now = DateTime.Now;
            var mod = new TbReview
            {
                BranchId = token.BranchId,
                CreateTime = now,
                NewsId = requset.Info.Id,
                NewsType = requset.Info.NewsType,
                OperId = requset.Info.UserId,
                OrgId = token.OrgId,
                Result = "",
                ReviewId = requset.Info.AuditId,
                // ReviewStatus = requset.Info.AuditStatus,

            };

            return dataAccess.CreateAudit(mod) > 0;


        }

        public GetAuditResponse GetAuditList(GetAuditRequest requset)
        {
            var response = new GetAuditResponse
            {
                TotalCount = 0,

            };

            var token = cacheHelper.GetData<TbUserToken>(requset.Token);

            var userinfo = OperdataAccess.GetOperDetail(token.UserId) ?? new TbOper();

            List<TbReview> list = dataAccess.GetAuditList(requset, userinfo.BranchId, out int i);

            if (list.Count == 0) throw new TransactionException("M01");

            var userInfo = OperdataAccess.GetOperList(list.Select(x => x.OperId).ToList());

            response.TotalCount = i;
            response.List = list.Select(x => new Audit
            {
                AuditId = x.ReviewId,
                // AuditName=x.
                // AuditStatus = x.ReviewStatus,l
                CreateTime = x.CreateTime.ToString("yyyy-MM-dd"),
                Id = x.NewsId,
                NewsType = x.NewsType,
                UserId = x.OperId,
                AuditName = x.Title,
                OperName = userInfo.FirstOrDefault(f => f.OperId == x.OperId)?.OperName,
                Result = x.Result,
                AuditStatus = x.ReviewStatus

            }).ToList();
            return response;
        }

        /// <summary>
        /// 发消息通知 记录用户流水 判断权限
        /// </summary>
        /// <param name="requset"></param>
        /// <returns></returns>
        public bool Audit(AuditInfo requset)
        {

            var token = cacheHelper.GetData<TbUserToken>(requset.Token);
            var authority = OperGroupdataAccess.GetAuthorityByToken(new RequestBase() { Token = requset.Token });
            var sql = new StringBuilder();
            int score = 0, userId = 0, oriScore = 0, branchId = 0;
            string title = "";
            TbOper userinfo = new TbOper();
            TbUserInfo us = new TbUserInfo();


            if (authority.List.All(x => x.FunCode != "Audit001"))
            {
                throw new TransactionException("M08");
            }

            if (requset.AuditType > 0)
            {
                userinfo = OperdataAccess.GetOperDetail(token.UserId) ?? new TbOper();

                requset.AuditType = userinfo.BranchId > 0 ? Type.支部 : Type.机构;
                branchId = userinfo.BranchId;
            }


            var scoreSetInfo = dataAccess.GetScoreSetInfo(token.OrgId);

            switch (requset.AuditStatus)
            {
                case AuditStatus.通过:
                    {
                        TbUserNotice notice;
                        TbUserScoreTrace userScoreTrace;
                        switch (requset.AuditType)
                        {
                            case 0:
                                switch (requset.Type)
                                {
                                    case AuditType.产品:

                                        sql.Append(@"UPDATE `eagles`.`tb_product` SET `Status` = 0  WHERE `ProdId`=@Id ");
                                        break;
                                    case AuditType.新闻:

                                        sql.Append(@"UPDATE `eagles`.`tb_news` SET `Status` = 0  WHERE `NewsId`=@Id ");
                                        break;
                                    case AuditType.用户:

                                        sql.Append(@"UPDATE `eagles`.`TB_USER_INFO` SET `Status` = 0  WHERE `UserId`=@Id ");
                                        break;
                                    case AuditType.活动:

                                        sql.Append(@"UPDATE `eagles`.`tb_activity` SET `Status` = 0  WHERE `ActivityId`=@Id ");
                                        break;
                                    case AuditType.任务:

                                        sql.Append(@"UPDATE `eagles`.`tb_task` SET `Status` = 0  WHERE `TaskId`=@Id ");
                                        break;
                                    case AuditType.新闻公开到机构:


                                       var News =  NewAccess.GetNewsDetail(new GetNewDetailRequset() {NewsId = requset.AuditId});
                                        if (News.IsPublicOrg != 1)
                                        {
                                            throw new TransactionException("M10");
                                        }

                                        sql.Append(@"UPDATE `eagles`.`tb_news` SET `IsPublicOrg` = 2  WHERE `NewsId`=@Id ");
                                        break;


                                }

                                break;
                            case Type.机构:
                                switch (requset.Type)
                                {

                                    case AuditType.用户文章:

                                        sql.Append(
                                            @"UPDATE `eagles`.`TB_USER_NEWS` SET `OrgReview` = 0  WHERE `NewsId`=@Id ");



                                        var newsDetail = PubdataAccess.GetNewsDetail(requset.AuditId);


                                        userId = newsDetail.UserId;

                                        var useinfo = UserdataAccess.GetUserInfoDetail(new GetUserInfoDetailRequest()
                                        {
                                            UserId = userId
                                        });

                                        oriScore = useinfo.Score;

                                        var t = "";
                                        if (newsDetail.NewsType == "0")
                                        {
                                            t = "文章";
                                        }
                                        else if (newsDetail.NewsType == "1")
                                        {
                                            t = "心得体会";
                                        }
                                        else if (newsDetail.NewsType == "2")
                                        {
                                            t = "会议";
                                        }

                                        if (newsDetail.NewsType == "3")
                                        {
                                            var autdUerInfo = UserdataAccess.GetUserInfoDetail(new GetUserInfoDetailRequest()
                                            {
                                                UserId = newsDetail.ToUser
                                            });

                                            UserdataAccess.SetUserInfoStatus(newsDetail.UserId, 0, autdUerInfo.BranchId);
                                        }
                                        else
                                        {
                                            var set1 = dataAccess.GetScoreSet(token.OrgId, 0, 4);
                                            score += set1;

                                            if (set1 > 0)
                                            {

                                                userScoreTrace = new TbUserScoreTrace()
                                                {
                                                    Comment = "机构审核" + t + "通过增积积分",
                                                    UserId = userId,
                                                    Score = set1,
                                                    RewardsType = "4",
                                                    OrgId = token.OrgId,
                                                    OriScore = oriScore,
                                                   
                                                };
                                                dataAccess.UserScoreTrace(userScoreTrace);
                                            }


                                            notice = new TbUserNotice()
                                            {
                                                Content = configuration.EaglesConfiguration.UserNoticContent
                                                    .Replace("${toUser}", us?.Name)
                                                    .Replace("${fromUser}", "党组织管理员")
                                                    .Replace("${Action}", " 审核通过了")
                                                    .Replace("${Content}", newsDetail?.Title + "的文章"),
                                                UserId = userId,
                                                NewsType = 17,
                                                FromUser = token.UserId,
                                                OrgId = token.OrgId,
                                                Title = "文章公开到党组织审核通过",
                                                IsRead = 1,
                                                TargetUrl = string.Format(configuration.EaglesConfiguration.PublicArticleUrl, newsDetail.OrgId, newsDetail.NewsId),
                                                

                                            };
                                            dataAccess.SendUserNotice(notice);

                                        }

                                        break;


                                    case AuditType.活动公开:


                                        score = dataAccess.GetScoreSet(token.OrgId, 0, 12);
                                        var userInfo = PubdataAccess.GetPublicActivityDetail(
                                            new GetPublicActivityDetailRequest() { ActivityId = requset.AuditId });



                                        userId = userInfo.ToUserId;


                                        sql.Append(
                                            @"UPDATE `eagles`.`TB_ACTIVITY` SET `OrgReview` = 0  WHERE `ActivityId`=@Id ");


                                        notice = new TbUserNotice()
                                        {
                                            Content = configuration.EaglesConfiguration.UserNoticContent
                                                .Replace("${toUser}", us?.Name)
                                                .Replace("${fromUser}", "党组织管理员")
                                                .Replace("${Action}", " 审核通过了")
                                                .Replace("${Content}", userInfo?.ActivityName + "的活动"),
                                            UserId = userId,
                                            NewsType = 17,
                                            FromUser = token.UserId,
                                            OrgId = token.OrgId,
                                            Title = "活动公开到党组织审核通过",
                                            IsRead = 1,
                                            TargetUrl = string.Format(configuration.EaglesConfiguration.ActivityNoticeUrl, userInfo.OrgId, userInfo.ToUserId),
                                           
                                        };
                                        dataAccess.SendUserNotice(notice);

                                        oriScore = UserdataAccess.GetUserInfoDetail(new GetUserInfoDetailRequest()
                                        {
                                            UserId = userId
                                        }).Score;

                                        if (score > 0)
                                        {
                                            userScoreTrace = new TbUserScoreTrace()
                                            {
                                                Comment = "活动机构审核通过增积积分",
                                                UserId = userId,
                                                Score = score,
                                                RewardsType = "12",
                                                OrgId = token.OrgId,
                                                OriScore = oriScore,
                                              
                                            };
                                            dataAccess.UserScoreTrace(userScoreTrace);
                                        }

                                        break;
                                    case AuditType.任务公开:


                                        score = dataAccess.GetScoreSet(token.OrgId, 0, 22);

                                        var task = PubdataAccess.GetPublicTaskDetail(
                                            new GetPublicTaskDetailRequest() { TaskId = requset.AuditId });


                                        sql.Append(
                                            @"UPDATE `eagles`.`TB_TASK` SET `OrgReview` = 0 WHERE `TaskId`=@Id ");

                                        userId = task.UserId;
                                        notice = new TbUserNotice()
                                        {
                                            Content = configuration.EaglesConfiguration.UserNoticContent
                                                .Replace("${toUser}", us?.Name)
                                                .Replace("${fromUser}", "党组织管理员")
                                                .Replace("${Action}", " 审核通过了")
                                                .Replace("${Content}", task?.TaskName + "的任务"),
                                            UserId = userId,
                                            NewsType = 28,
                                            FromUser = token.UserId,
                                            OrgId = token.OrgId,
                                            TargetUrl = string.Format(configuration.EaglesConfiguration.TaskNoticeUrl, task.OrgId, task.TaskId),
                                            Title = "任务公开到党组织审核通过",
                                            IsRead = 1,
                                            
                                        };
                                        dataAccess.SendUserNotice(notice);

                                        oriScore = UserdataAccess.GetUserInfoDetail(new GetUserInfoDetailRequest()
                                        {
                                            UserId = userId
                                        }).Score;

                                        if (score > 0)
                                        {
                                            userScoreTrace = new TbUserScoreTrace()
                                            {
                                                Comment = "任务机构审核通过增加积分",
                                                UserId = userId,
                                                Score = score,
                                                RewardsType = "22",
                                                OrgId = token.OrgId,
                                                OriScore = oriScore,
                                              
                                            };


                                            dataAccess.UserScoreTrace(userScoreTrace);
                                        }

                                        break;
                                }

                                break;
                            case Type.支部:
                                switch (requset.Type)
                                {
                                    case AuditType.用户文章:

                                        var newsDetail = PubdataAccess.GetNewsDetail(requset.AuditId);


                                        userId = newsDetail.UserId;


                                        us = UserdataAccess.GetUserInfoDetail(
                                            new GetUserInfoDetailRequest() { UserId = newsDetail.UserId });

                                        var set1 = dataAccess.GetScoreSet(token.OrgId, 0, 3);

                                        var s3 = 0;




                                        if (newsDetail.IsPublic == 2)
                                        {
                                            var t = "";
                                            switch (newsDetail.NewsType)
                                            {
                                                case "0":
                                                    t = "文章";
                                                    break;
                                                case "1":
                                                    t = "心得体会";
                                                    break;
                                                case "2":
                                                    t = "会议";
                                                    break;
                                            }

                                            score += set1;


                                            if (score > 0)
                                            {
                                                userScoreTrace = new TbUserScoreTrace()
                                                {
                                                    Comment = "支部" + t + "审核通过增积积分",
                                                    UserId = userId,
                                                    Score = score,
                                                    RewardsType = "22",
                                                    OrgId = token.OrgId,
                                                    OriScore = oriScore,
                                                   
                                                };

                                                dataAccess.UserScoreTrace(userScoreTrace);

                                            }

                                        }


                                        sql.Append(
                                            @"UPDATE `eagles`.`TB_USER_NEWS` SET `BranchReview` = 0  WHERE `NewsId`=@Id ");

                                        notice = new TbUserNotice()
                                        {
                                            Content = configuration.EaglesConfiguration.UserNoticContent
                                                .Replace("${toUser}", us?.Name)
                                                .Replace("${fromUser}", "党支部管理员")
                                                .Replace("${Action}", " 审核通过了")
                                                .Replace("${Content}", newsDetail?.Title + "的文章"),
                                            UserId = newsDetail.UserId,
                                            NewsType = 30,
                                            FromUser = token.UserId,
                                            OrgId = token.OrgId,
                                            Title = "文章公开到党支部审核通过",
                                            IsRead = 1,
                                            TargetUrl = string.Format(configuration.EaglesConfiguration.PublicArticleUrl, newsDetail.OrgId, newsDetail.NewsId),
                                           
                                        };
                                        dataAccess.SendUserNotice(notice);



                                        break;


                                    case AuditType.活动公开:

                                        var tbActivity = PubdataAccess.GetPublicActivityDetail(
                                            new GetPublicActivityDetailRequest() { ActivityId = requset.AuditId });





                                        userId = tbActivity.ToUserId;

                                        if (tbActivity.IsPublic == 2)
                                        {
                                            score = dataAccess.GetScoreSet(token.OrgId, 0, 11);

                                            sql.Append(
                                                @"UPDATE `eagles`.`TB_ACTIVITY` SET `BranchReview` = 0  WHERE `ActivityId`=@Id ");

                                            if (score > 0)
                                            {

                                                userScoreTrace = new TbUserScoreTrace()
                                                {
                                                    Comment = "活动支部审核通过增积积分",
                                                    UserId = userId,
                                                    Score = score,
                                                    RewardsType = "22",
                                                    OrgId = token.OrgId,
                                                    OriScore = oriScore,
                                                   
                                                };


                                                dataAccess.UserScoreTrace(userScoreTrace);
                                            }

                                        }
                                        else
                                        {
                                            sql.Append(
                                                @"UPDATE `eagles`.`TB_ACTIVITY` SET `BranchReview` = 0  WHERE `ActivityId`=@Id ");

                                        }

                                        us = UserdataAccess.GetUserInfoDetail(
                                            new GetUserInfoDetailRequest() { UserId = tbActivity.ToUserId });
                                        notice = new TbUserNotice()
                                        {
                                            Content = configuration.EaglesConfiguration.UserNoticContent
                                                .Replace("${toUser}", us?.Name)
                                                .Replace("${fromUser}", "党支部管理员")
                                                .Replace("${Action}", " 审核通过了")
                                                .Replace("${Content}", tbActivity.ActivityName + "的活动"),
                                            UserId = tbActivity.FromUser,
                                            NewsType = 16,
                                            FromUser = token.UserId,
                                            OrgId = token.OrgId,
                                            Title = "活动公开到党支部审核通过",
                                            IsRead = 1,
                                            TargetUrl = string.Format(configuration.EaglesConfiguration.ActivityNoticeUrl, tbActivity.OrgId, tbActivity.ToUserId),
                                           
                                        };
                                        dataAccess.SendUserNotice(notice);

                                        break;
                                    case AuditType.任务公开:

                                        var tbTask = PubdataAccess.GetPublicTaskDetail(
                                            new GetPublicTaskDetailRequest() { TaskId = requset.AuditId });

                                        userId = tbTask.UserId;

                                        if (tbTask.IsPublic == 2)
                                        {
                                            score = dataAccess.GetScoreSet(token.OrgId, 0, 21);
                                            sql.Append(
                                                @"UPDATE `eagles`.`TB_TASK` SET `BranchReview` = 0  WHERE `TaskId`=@Id ");

                                            if (score > 0)
                                            {
                                                userScoreTrace = new TbUserScoreTrace()
                                                {
                                                    Comment = "任务公开支部审核通过增积积分",
                                                    UserId = userId,
                                                    Score = score,
                                                    RewardsType = "22",
                                                    OrgId = token.OrgId,
                                                    OriScore = oriScore,
                                                    
                                                };


                                                dataAccess.UserScoreTrace(userScoreTrace);
                                            }

                                        }
                                        else
                                        {
                                            sql.Append(
                                                @"UPDATE `eagles`.`TB_TASK` SET `BranchReview` = 0  WHERE `TaskId`=@Id ");

                                        }

                                        us = UserdataAccess.GetUserInfoDetail(
                                            new GetUserInfoDetailRequest() { UserId = tbTask.FromUser });
                                        notice = new TbUserNotice()
                                        {
                                            Content = configuration.EaglesConfiguration.UserNoticContent
                                                .Replace("${toUser}", us?.Name)
                                                .Replace("${fromUser}", "党支部管理员")
                                                .Replace("${Action}", " 审核通过了")
                                                .Replace("${Content}", tbTask.TaskName + "的任务"),
                                            UserId = tbTask.FromUser,
                                            NewsType = 27,
                                            FromUser = token.UserId,
                                            OrgId = token.OrgId,
                                            Title = "任务公开到党支部审核通过",
                                            IsRead = 1,
                                            TargetUrl = string.Format(configuration.EaglesConfiguration.TaskNoticeUrl, tbTask.OrgId, tbTask.TaskId),
                                            
                                        };
                                        dataAccess.SendUserNotice(notice);
                                        break;
                                }
                                break;
                        }

                        break;
                    }

                case AuditStatus.不通过:
                    switch (requset.AuditType)
                    {
                        case 0:
                            switch (requset.Type)
                            {
                                case AuditType.产品:


                                    sql.Append(@"UPDATE `eagles`.`tb_product` SET `Status` = 1  WHERE `ProdId`=@Id ");
                                    break;
                                case AuditType.新闻:


                                    sql.Append(@"UPDATE `eagles`.`tb_news` SET `Status` = 1  WHERE `NewsId`=@Id ");
                                    break;
                                case AuditType.用户:


                                    sql.Append(@"UPDATE `eagles`.`TB_USER_INFO` SET `Status` = 1  WHERE `UserId`=@Id ");
                                    break;

                                case AuditType.活动:

                                    sql.Append(@"UPDATE `eagles`.`tb_activity` SET `Status` =  1  WHERE `ActivityId`=@Id ");
                                    break;
                                case AuditType.任务:

                                    sql.Append(@"UPDATE `eagles`.`tb_task` SET `Status` =  1  WHERE `TaskId`=@Id ");
                                    break;
                                case AuditType.新闻公开到机构:

                                    sql.Append(@"UPDATE `eagles`.`tb_news` SET `IsPublicOrg` = 2  WHERE `NewsId`=@Id ");
                                    break;

                                    
                            }

                            break;
                        case Type.机构:
                            switch (requset.Type)
                            {


                                case AuditType.用户文章:

                                    sql.Append(
                                        @"UPDATE `eagles`.`TB_USER_NEWS` SET `OrgReview` = 1  WHERE `NewsId`=@Id ");
                                    break;

                                case AuditType.活动公开:

                                    sql.Append(
                                        @"UPDATE `eagles`.`TB_ACTIVITY` SET `OrgReview` = 1  WHERE `ActivityId`=@Id ");
                                    break;
                                case AuditType.任务公开:

                                    sql.Append(
                                        @"UPDATE `eagles`.`TB_TASK` SET `OrgReview` = 1  WHERE `TaskId`=@Id ");
                                    break;
                            }

                            break;
                        case Type.支部:
                            switch (requset.Type)
                            {

                                case AuditType.用户文章:

                                    sql.Append(
                                        @"UPDATE `eagles`.`TB_USER_NEWS`  SET `BranchReview` = 1  WHERE `NewsId`=@Id ");
                                    break;

                                case AuditType.活动公开:

                                    sql.Append(
                                        @"UPDATE `eagles`.`TB_ACTIVITY` SET `BranchReview` = 1  WHERE `ActivityId`=@Id ");
                                    break;
                                case AuditType.任务公开:

                                    sql.Append(
                                        @"UPDATE `eagles`.`TB_TASK` SET `BranchReview` = 1  WHERE `TaskId`=@Id ");
                                    break;
                            }

                            break;
                    }

                    break;
            }


            if (sql.Length == 0)
            {
                throw new TransactionException("M10");

            }


            switch (requset.Type)
            {
                case AuditType.产品:

                    title = goodAccess.GetGoodsDetail(new GetGoodsDetailRequset() { GoodsId = requset.AuditId })?.ProdName;

                    break;
                case AuditType.新闻:


                    title = NewAccess.GetNewsDetail(new GetNewDetailRequset() { NewsId = requset.AuditId })?.Title;
                    break;
                case AuditType.用户:

                    title = UserdataAccess.GetUserInfoDetail(new GetUserInfoDetailRequest() { UserId = requset.AuditId })?.Name;
                    break;

                case AuditType.任务:
                case AuditType.任务公开:

                    title = PubdataAccess.GetPublicTaskDetail(
                        new GetPublicTaskDetailRequest() { TaskId = requset.AuditId })?.TaskName;

                    break;
                case AuditType.活动:
                case AuditType.活动公开:

                    title = PubdataAccess.GetPublicActivityDetail(
                       new GetPublicActivityDetailRequest() { ActivityId = requset.AuditId })?.ActivityName;

                    break;
                case AuditType.用户文章:
                    var news = PubdataAccess.GetNewsDetail(requset.AuditId);
                    title = news?.Title;
                    break;

            }




            var now = DateTime.Now;
            var mod = new TbReview
            {
                BranchId = branchId,
                CreateTime = now,
                NewsId = requset.AuditId,
                NewsType = ((int)requset.Type).ToString(),
                OperId = token.UserId,
                OrgId = token.OrgId,
                Result = requset.Reason,
                ReviewId = requset.AuditId,
                ReviewStatus = requset.AuditStatus,
                Title = title,
                //Source = title,
            };

            dataAccess.CreateAudit(mod);

            if (score > 0 && userId > 0)
            {
                dataAccess.SetUserScore(score, userId);
            }

            return dataAccess.Audit(sql.ToString(), requset.AuditId) > 0;

        }

        public bool BatchAudit(batchAuditInfo requset)
        {
            try
            {
                foreach (var auditId in requset.AuditId)
                {

                    Audit(new AuditInfo()
                    {

                        AuditId = auditId,
                        AuditStatus = requset.AuditStatus,
                        AuditType = requset.AuditType,
                        Reason = requset.Reason,
                        Token = requset.Token,
                        Type = requset.Type

                    });
                }

                return true;
            }
            catch
            {

                return false;
            }


        }
    }
}
